package org.example.tialsproject.controller;

import org.example.tialsproject.pojo.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.UUID;

@RestController
public class UploadController {
    @PostMapping("/upload")
    public ResponseResult upload(MultipartFile image) throws Exception {
        /*
        String originalFilename = image.getOriginalFilename();
        String name = UUID.randomUUID().toString() + originalFilename.substring(originalFilename.lastIndexOf("."));
        image.transferTo(new File("D:\\BaiduNetdiskDownload" + name));
        return ResponseResult.success("上传文件成功");
        */

        return  null;
    }
}
